package com.example.rfidserver.consume.subactivity;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Context;
import android.os.Bundle;
import android.widget.ListView;

import com.example.rfidserver.R;
import com.example.rfidserver.consume.adapter.IntegralManagerAdapter;
import com.example.rfidserver.consume.adapter.SiteConsumeAdapter;
import com.example.rfidserver.dao.UserDao;
import com.example.rfidserver.pojo.User;

import java.util.List;

/*显示一下user_id,user_integral*/
public class IntegralMangagerActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_integral_mangager);
        UserDao userDao = new UserDao();
        List<User> userInfo = userDao.getUserInfo();
        initview(this,userInfo);
        System.out.println(userInfo);

    }

    private void initview(Context context, List<User> users) {
        final ListView mylistview = findViewById(R.id.mylistview_integral);
        final IntegralManagerAdapter integralManagerAdapter = new IntegralManagerAdapter(context,users);
        mylistview.setAdapter(integralManagerAdapter);
    }
}
